package com.bingo.mpa.pojo;


import java.sql.Timestamp;
import java.util.Map;

import org.apache.commons.beanutils.BeanUtils;
import org.express.portal.persist.POJO;

public class Phone extends POJO
{
	private static final long serialVersionUID = 1L;
	private long pid;
	private long aid;
	private byte carrier;
	private byte brand;	//品牌
	private byte card_type;//卡类别，区分新1卡，新2卡
	private String phone;
	private int retail;
	private int discount;
	private String province;
	private String city;
	private byte status;
	private Timestamp lock_time;
	private Timestamp active_time;
	public Phone()
	{
		super._this_table_name = "P_PHONE";
		this.card_type = 0;
		this.status = 1;
	}
	public long getPid()
	{
		return pid;
	}
	public void setPid(long pid)
	{
		this.pid = pid;
	}
	public long getAid()
	{
		return aid;
	}
	public void setAid(long aid)
	{
		this.aid = aid;
	}
	public byte getCarrier()
	{
		return carrier;
	}
	public void setCarrier(byte carrier)
	{
		this.carrier = carrier;
	}
	public byte getBrand()
	{
		return brand;
	}
	public void setBrand(byte brand)
	{
		this.brand = brand;
	}
	public byte getCard_type()
	{
		return card_type;
	}
	public void setCard_type(byte card_type)
	{
		this.card_type = card_type;
	}
	public String getPhone()
	{
		return phone;
	}
	public void setPhone(String phone)
	{
		this.phone = phone;
	}
	public int getRetail()
	{
		return retail;
	}
	public void setRetail(int retail)
	{
		this.retail = retail;
	}
	public int getDiscount()
	{
		return discount;
	}
	public void setDiscount(int discount)
	{
		this.discount = discount;
	}
	public String getProvince()
	{
		return province;
	}
	public void setProvince(String province)
	{
		this.province = province;
	}
	public String getCity()
	{
		return city;
	}
	public void setCity(String city)
	{
		this.city = city;
	}
	public byte getStatus()
	{
		return status;
	}
	public void setStatus(byte status)
	{
		this.status = status;
	}
	public Timestamp getLock_time()
	{
		return lock_time;
	}
	public void setLock_time(Timestamp lock_time)
	{
		this.lock_time = lock_time;
	}
	public Timestamp getActive_time()
	{
		return active_time;
	}
	public void setActive_time(Timestamp active_time)
	{
		this.active_time = active_time;
	}
	@SuppressWarnings("unchecked")
	protected Map<String, Object> listInsertableFields()
	{
		try
		{
			Map<String, Object> props = BeanUtils.describe(this);
			if (getId() <= 0)
			{
				if(props.containsKey("id"))
				{
					props.remove("id");
				}
				if(props.containsKey("pid"))
				{
					props.remove("pid");
				}
			}
			props.remove("class");
			return props;
		}
		catch (Exception e)
		{
			throw new RuntimeException("Exception when Fetching fields of " + this);
		}
	}
}
